package lab02.Test19;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/10/28.
 */
public class Test19 {
    public static void main(String[] args) {
        String str;
        Scanner scanner=new Scanner(System.in);
        str=scanner.next();
        char[] ch = str.toCharArray();
        StringBuffer buffer = new StringBuffer();
        for (int i = str.length() - 1; i >= 0; i--) {
            if(ch[i]>='A'&&ch[i]<='Z'){
                buffer.append(String.valueOf(ch[i]).toLowerCase());
            }
            else if (ch[i]>='a'&&ch[i]<='z'){
                buffer.append(String.valueOf(ch[i]).toUpperCase());
            }
        }
        System.out.println(buffer.toString());
    }
}

